package de.connecttext.model;

import java.util.List;

import de.connecttext.dao.IdGenerator;

/**
 * ObjectRepresentation of a document in the index containing its id and the
 * related Tags
 * 
 * @author conrad
 * 
 */
public class TextDocument {

	
	private int uniqueDocId;
	// path to Document - used as UniqueResourceIdentifier
	private String solrId;
	// MetaData of the Document. easily expandable.
	private MetaData metaData;
	// All Tags and their Vectors associated to this Document
	private List<TagVector> tagVectors;

	public TextDocument() {
	}
	
	public void setSolrId(String solrId) {
		this.solrId = solrId;
	}

	public String getSolrId() {
		return solrId;
	}

	public void setTagVectors(List<TagVector> tagVectors) {
		this.tagVectors = tagVectors;
	}

	public List<TagVector> getTagVectors() {
		return tagVectors;
	}

	public void setMetaData(MetaData metaData) {
		this.metaData = metaData;
	}

	public MetaData getMetaData() {
		return metaData;
	}

	public String toString() {
		String toReturn = this.solrId + ": " + this.metaData.getTitle() + " by "
				+ this.metaData.getAuthor() + " Tags: "
				+ this.tagVectors.size();
		for (int i = 0; i < this.tagVectors.size(); i++) {
			toReturn = toReturn.concat("\n + "
					+ this.tagVectors.get(i).getOriginalTerm() + "; lemma: "
					+ this.tagVectors.get(i).getLemmatizedTerm());
		}
		return toReturn;
	}

	public void setUniqueDocId(int uniqueDocId) {
		this.uniqueDocId = uniqueDocId;
	}
	public int getUniqueDocId() {
		return uniqueDocId;
	}

	public int getTagCount() {
		return tagVectors.size();
	}

}
